<?php
/**
 * 发现管理类
 */
namespace App\Controller\Index;

use Common\Controller\App\SignController;
use Common\Model\DiscoveredModel;

class DiscoveredController extends SignController{
    /**
     * 发现列表
     */
    public function lists(){
        $page = I('get.page')?I('get.page'):1;
        $limit = I('get.limit')?I('get.limit'):20;
        $num = ($page-1)*$limit;
        $model = new DiscoveredModel();
        $list = $model->getlist($num,$limit);
        $this->ajaxReturn(['code'=>200,'list'=>$list]);
    }

    /**
     * 发现详情
     */
    public function discovered_info(){
        $id = I('get.id');
        if(empty($id)){
            $this->ajaxReturn(['code'=>300,'msg'=>'发现编号错误']);
        }
        $model = new DiscoveredModel();
        $info = $model->where("id=$id and status=1")->find();
        $this->ajaxReturn(['code'=>200,'info'=>$info]);
    }

}